<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>IT服务信息平台  首页</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/mystyle.css">
	<script type='text/javascript' src='/gserv/dwr/interface/load.js'></script>
  	<script type='text/javascript' src='/gserv/dwr/engine.js'></script>
  	<script type='text/javascript' src='/gserv/dwr/interface/userDaoImpl.js'></script>
	<script>
		function addCall1()
		{
			var userName=document.getElementById("userName").value;
			var userPwd=document.getElementById("userPwd").value;
			if(userName=="" || userPwd=="")
			{
				error.innerHTML='用户名或密码不能为空!';
			}else
			{
				error.innerHTML='';
				userDaoImpl.login1(userName,userPwd,addCall2);
			}
		}
		function addCall2(data)
		{
			if(data){
				error.innerHTML='';
				document.login.submit();
			}else
			{
				error.innerHTML='用户名与密码不匹配!';
			}
			
		}
	</script>
  </head>
  <body>
  <div id="all" style="width: 800px;">
  	<!-- 顶 -->
  	<div><jsp:include page="header.jsp"></jsp:include></div>
  	<!-- 中 -->
  	<div id="middle" style="width: 800px;margin: 0 auto;margin-top: 2px;margin-bottom: 2px;border-style: solid;border-width: 1px;">
  		<!-- 中左 -->
		<div style="width: 600px;border-style:solid;border-width: 1px;float: left;">
  			<div id="div" style="height:60px;border-bottom-style:solid;border-width: 1px;">
  				<input type="hidden" name="islogin" value='<s:property value="%{#session.user.userName}"/>'/>
  			</div>
  			<div><s:action name="gx_load" executeResult="true"></s:action></div>
  			<div><table><tr><td>
  				
  			</td></tr></table></div>
 		</div>
 		<!-- 中右-->
  		<div style="width: 190px;float: right;border-style: none;">
  			<!-- 1 -->
  			<s:if test="#session['user']!=null">
  			<div id="login_b" class="callSort" style="height:60px;">
	  					<div class="mleft"><strong>欢迎:${sessionScope.user.userName }您！</strong></div>
	  					<div>
	  						<table>
	  						<tr><td><a href="gongxu/usr_getUserInfoById.shtml" target="_blank">我的空间</a></td></tr>
	  						<tr><td><a href="gongxu/logout.jsp">注销</a></td></tr>
	  						</table>
	  					</div>
  			</div>	
  			</s:if>
  			<s:else>
  			<!-- 2 -->
  			<div id="login_f"  class="login_f" style="height:100px;">
  					<div class="mleft"><strong>用户登录</strong></div>
  					<div>
  						<table>
  						<s:form id="login" name="login" action="usr_login" namespace="/gongxu">
  						<tr><td style="font-size: 12px;">用户名</td>
  						<td><s:textfield id="userName" name="userInfo.userName" cssStyle="width:85px;height:18px;"></s:textfield>
  						</td></tr>
  						<tr><td style="font-size: 12px;">密  码：</td>
  						<td><s:password id="userPwd" name="userPwd" cssStyle="width:85px;height:18px;"></s:password>
  						</td></tr>
  						<tr height="10px;"><td colspan="2"><SPAN id="error"  style="color: red;font-size: 12px;"></SPAN></td></tr>
  						<tr><td colspan="2" align="center">
  						<img src="css/img/login1.gif" onclick="addCall1()"/>
  						<img src="css/img/register.gif" onclick="javascript:location.href='register.jsp'"/></td></tr>
  						</s:form>
  						</table>
  					</div>
  			</div>
  			</s:else>
  			<!-- 2 -->
  			<jsp:include page="center_right.jsp"></jsp:include>
  		  </div>
  	</div>
  	<!-- 底 -->
  	<div><jsp:include page="bottom.jsp"></jsp:include></div>
  </div>
  </body>
</html>
